import request from '../utils/request';
import { API } from '../utils/config';

/**
 * 获取标签列表
 */
export const getTagList = () => {
  return request({
    url: `${API.CLASSES}/ProductTag`,
    method: 'GET'
  });
};

/**
 * 创建标签
 * @param data 标签数据
 */
export const createTag = (data: any) => {
  return request({
    url: `${API.CLASSES}/ProductTag`,
    method: 'POST',
    data
  });
};

/**
 * 更新标签
 * @param id 标签ID
 * @param data 标签数据
 */
export const updateTag = (id: string, data: any) => {
  return request({
    url: `${API.CLASSES}/ProductTag/${id}`,
    method: 'PUT',
    data
  });
};

/**
 * 删除标签
 * @param id 标签ID
 */
export const deleteTag = (id: string) => {
  return request({
    url: `${API.CLASSES}/ProductTag/${id}`,
    method: 'DELETE'
  });
};

/**
 * 获取标签详情
 * @param id 标签ID
 */
export const getTagDetail = (id: string) => {
  return request({
    url: `${API.CLASSES}/ProductTag/${id}`,
    method: 'GET'
  });
};